package com.hl.payServer.serializer;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.hl.payServer.util.DateUtil;

import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 日期反序列化器
 */
public class DateDeserializer extends JsonDeserializer<Date> {
 
    @Override
    public Date deserialize(JsonParser parser, DeserializationContext context)
      throws IOException {


        Map<String,Map<String,Object>> map=new HashMap<String,Map<String,Object>>();

        Map<String,Object> params=new HashMap<String,Object>();
        params.put("user","lilianqang");
        params.put("pwd","123");
        params.put("001","ssss[],sss[]");
        params.put("002","ssss[],sss[]");
        map.put("wuliu",params);




        return DateUtil.turnStringToDate(parser.getValueAsString(), "yyyyMMddHHmmss");
    }
}